﻿namespace OneWorks.DataBase
{
    using System;
    using System.Collections.Generic;

    public partial class OneWorksContext
        : System.Data.Entity.DbContext
    {
        public OneWorksContext()
            :base("Name=OneWorksContext")
        { }

        public System.Data.Entity.DbSet<OneWorks.DataBase.Entity.Icon> Icons { get; set; }
        public System.Data.Entity.DbSet<OneWorks.DataBase.Entity.Image> Images { get; set; }
        public System.Data.Entity.DbSet<OneWorks.DataBase.Entity.User> Users { get; set; }
        public System.Data.Entity.DbSet<OneWorks.DataBase.Entity.Log> Logs { get; set; }
        public System.Data.Entity.DbSet<OneWorks.DataBase.Entity.Menu> Menus { get; set; }
        public System.Data.Entity.DbSet<OneWorks.DataBase.Entity.MenuRelation> MenuRelations { get; set; }

        protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new OneWorks.DataBase.Mapping.IconMap());
            modelBuilder.Configurations.Add(new OneWorks.DataBase.Mapping.ImageMap());
            modelBuilder.Configurations.Add(new OneWorks.DataBase.Mapping.UserMap());
            modelBuilder.Configurations.Add(new OneWorks.DataBase.Mapping.LogMap());
            modelBuilder.Configurations.Add(new OneWorks.DataBase.Mapping.MenuMap());
            modelBuilder.Configurations.Add(new OneWorks.DataBase.Mapping.MenuRelationMap());

            InitializeMapping(modelBuilder);
        }
    }
}